<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title></title>
</head>

<body>
    <input type="checkbox" id="ck" />
    <hr />
    <div id="div">
        <input type="checkbox" /><br />
        <input type="checkbox" /><br />
        <input type="checkbox" /><br />
        <input type="checkbox" /><br />
        <input type="checkbox" />
    </div>
</body>
<script>
    document.getElementById("ck").onclick = function () {
        let arrInputs = document.getElementById("div").children
        for(i=0;i<arrInputs.length;i++){
            let oInput = arrInputs[i]
            oInput.checked = this.checked
        }
    }
</script>

</html>